<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>	
<%@ include file="/pub/headmeta.jsp" %>
</head>
<body>
	<div align="center" style="width: 98%">	
		<form id="addForm" method="post" action="${ctx}/test!test.action" enctype="multipart/form-data">			
			<table class="table_border" style="width: 600px">
				<tr>
					<td width="35%" align="right">名称：</td>
					<td width="65%"><input type="text" name="name" id="name" style="width: 80%" value="test测试"/></td>					
				</tr>			
				
			</table>
			<input type="button" class="button" value="测试1" onclick="upload();"/>
			<input type="button" class="button" value="测试2" onclick="uploadEx();"/>
		</form>	

	</div>
</body>
</html>
<script type="text/javascript">
<!--

function upload(){	
	$.upload({        
        url: '${ctx}/test!test.action', 
        params: {"name": $('#name').val()},
        dataType: 'json',        
        onSend: function() {
        	return true;
        },        
        onComplate: function(json) {        	
    		alert('json-->'+json.code);    		
        }
	});
	
	
	

}
function uploadEx(){	
	$.uploadEx({        
		url: '${ctx}/test!test.action', 
		formId: "addForm",
		dataType: 'json',  
		onSend: function() {
	        return true;
	    },     
		onComplate: function(json) {        	
			alert('json-->'+json.code);
		}
	});
}

//-->
</script>
